package com.yuantu.judiciary.model.domain;

import com.yuantu.judiciary.model.BaseDO;
import com.yuantu.judiciary.model.enums.MessageType;
import lombok.Data;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * 用户信息表
 *
 * @author syw
 * @since 2023-06-12
 **/
@Data
@Entity
@DynamicUpdate
@Table(name = "user_message")
public class UserMessageDO extends BaseDO {

    /**
     * 关联id
     */
    @Column(nullable = false)
    @Comment("关联id")
    private Long relativeId;

    /**
     * 标题
     */
    @Comment("标题")
    private String title;

    /**
     * 内容
     */
    @Column(columnDefinition = "text")
    @Comment("内容")
    private String content;

    /**
     * 消息类型
     */
    @Enumerated(EnumType.STRING)
    @Column(length = 10, nullable = false)
    @Comment("消息类型")
    private MessageType type;

    /**
     * 是否已读
     */
    @Column(name = "is_read", nullable = false)
    @Comment("是否已读")
    private Boolean readed = false;

    /**
     * 备注：动态消息-查询类型，系统消息可以不填
     */
    @Comment("备注：动态消息-查询类型，系统消息可以不填")
    private String remark;

}
